<template>
  <div class="delRole">
    <div class="box">
      <h2>删除角色</h2>
      <div class="but">
        <el-button>取消</el-button>
        <el-button type="primary" @click="fn">确定</el-button>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { getDelRole } from '@/api/delRole'
import { useCounterStoreB } from '@/stores/temporary'
const storeB = useCounterStoreB()
const rowId = ref(storeB.rowId)
const fn = async () => {
  try {
    await getDelRole(rowId.value)
  } catch (error) {
    console.log(error)
  }
}
watch(
  () => storeB.rowId,
  (newVal) => {
    rowId.value = newVal
  },
)
</script>

<style scoped lang="scss">
.box {
  background: #fff;
  padding: 10px;
  .but {
    max-width: 10px 0;
  }
}
</style>
